from django.db import models
from courses.models import Course
from django.contrib.auth.models import User
from STIP.settings import MEDIA_ROOT

# Create your models here.
class Lecture(models.Model):
    title=models.CharField(max_length=500)
    course=models.ForeignKey(Course)
    isStarted=models.BooleanField()
    isEnded=models.BooleanField()
    lectureFile=models.FileField(upload_to=MEDIA_ROOT)
class filename(models.Model):
    lecture=models.OneToOneField(Lecture)
    name=models.CharField(max_length=500)
class Quiz(models.Model):
    duration = models.IntegerField(default=15)
    title=models.CharField(max_length=500)
    bonusPoints=models.IntegerField(default=5)
    lecture= models.ForeignKey(Lecture)
    isStarted=models.BooleanField()
    isEnded=models.BooleanField()
#
#class Question(models.Model):
#    body=models.CharField(max_length=500)
#    quiz= models.ForeignKey(Quiz)
#    grade=models.IntegerField(default=5)
#    
class Answer(models.Model):
    quiz=models.ForeignKey(Quiz)
    body=models.CharField(max_length=500)
    isRight=models.BooleanField()
 
class Grade(models.Model):
    grade=models.IntegerField(default=5)
    quiz= models.ForeignKey(Quiz)
    choice=models.ForeignKey(Answer)
    user= models.ForeignKey(User)
    

 
    





